home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-04-24 | 1.4 KB | 66 lines | [TEXT/YERK] |
- \ 4.6.87 rfl vbl queue manipulation
- \ 1.1.88 rfl general cleanup
- \ 4.22.93 rfl changed proc method
-
- hex
-
- create vinstall
- 205f w, \ move.l (a7)+,a0
- a033 w, \ call vinstall
- 48c0 w, \ ext.l d0
- 2f00 w, \ move.l d0,-(a7)
- next,
-
- create vremove
- 205f w, \ move.l (a7)+,a0
- a034 w, \ call vremove
- 48c0 w, \ ext.l d0
- 2f00 w, \ move.l d0,-(a7)
- next,
- decimal
-
- :CLASS vblTask <super object
-
- var qlink
- int qtype
- var procPtr
- int vblCount
- int vblPhase
-
- var myProc
-
- :M init: ( 'cProc --) >body put: myProc ;M
-
- ( 1/60ths of second -- )
- :M SetDelay: put: vblCount ;M
-
- ( -- errcode)
- :M install: get: myProc body> initProc get: myProc +base put: procPtr
- abs: self vinstall abort" install error" ;M
-
- ( -- errcode)
- :M remove: abs: self vremove . ;M
-
- :M classinit: 1 put: qtype ;M
-
- ;class
-
- vblTask myTask
-
- \ Now to use this, create a :Vproc definition which is the background task
- \ you want to perform. You can set the delay (in 1/60ths
- \ of a second) for periodic execution using the setDelay: method. The
- \ task itself must reset this delay everytime it executes. The task
- \ should ultimately be written in assembly, since all other events
- \ are on hold while your word is being executed.
-
- \ example below
- 0 value aCounter
- :Proc counter -curs pushport set: fwind
- home aCounter . 1 ++> aCounter 60 setdelay: myTask popPort ;proc
- 'c counter init: myTask
- 120 setdelay: myTask
- \ 'c counter install: myTask
- \ to remove, say remove: myTask
-
-